package com.common.retrofit.bearusermethod;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.bean.FirstSortBean;
import com.common.retrofit.service.BearUserService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class GetFirstSortMethods extends BaseMethods {

    private static GetFirstSortMethods m_ins = null;

    public static GetFirstSortMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetFirstSortMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetFirstSortMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "api/Goods/";
    }

    private BearUserService initService() {
        return getRetrofit().create(BearUserService.class);
    }


    public void     categoryOne   (Subscriber<FirstSortBean> subscriber ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().categoryOne(time,SortUtils.getMyHash("uid","hashid" ,"time"+time),Constans.ANDROID_APP_ID,"3","","");
        toSubscribe(observable, subscriber);
    }
}
